<?php
/**
 * Description of Finder
 *
 * @author chedim
 */
class sFileFinder extends sClass
{
    private static $include_path = null;

    public static function find_include($file_name)
    {
        if (self::$include_path === null)
        {
            self::$include_path = explode(PATH_SEPARATOR, get_include_path());
        }

        $c = count(self::$include_path);
        for($i=0; $i<$c; $i++)
        {
            $suggest = self::$include_path[$i].DIRECTORY_SEPARATOR.$file_name;
            if(file_exists($suggest))
            {
                return $suggest;
            }
        }
        throw new eNotFound();
    }
}
?>
